{
  Ivanov Nikita
  23/10/2012
  Finds Pi
}

program PiPiFinder;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  i, n, n0 : integer;
  x, y :real;
  fout:textFile;

begin
  randomize;
  assignFile(fout, 'output.txt');
  rewrite(fout);
  n0:=0;
  n:=0;
  for i:=0 to 100000000 do
  begin
    x:=2*random;
    y:=2*random;
    n:=n+1;
    if ((x-1)*(x-1) +  (y-1)*(y-1) <= 1) then
      n0:=n0+1;
    if (n mod 3100= 0) then
      writeln(fout, 4*n0/n:0:5);
  end;
  closeFile(fout);
  writeln(4*n0/n:0:5);
  readln;
end.
 